//
//  ProductsItem.swift
//  weile
//
//  Created by LKM on 16/10/9.
//  Copyright © 2016年 LKM. All rights reserved.
//

import UIKit
import Kingfisher

class ProductsItem: UITableViewCell {
    @IBOutlet weak var img_head: UIImageView!
    @IBOutlet weak var lbl_title: UILabel!
    @IBOutlet weak var lbl_title1: UILabel!
    @IBOutlet weak var lbl_title2: UILabel!

    @IBOutlet weak var lbl_title3: UILabel!
    
    @IBOutlet weak var lbl_title4: UILabel!
    
    
    var mProductItemM:ProductItemM! {
    
        didSet{
            lbl_title.setText(str: mProductItemM.goodsName);
            lbl_title1.setText(str: mProductItemM.sku1);
            lbl_title2.setText(str: mProductItemM.sku2);
            lbl_title3.setText(str: mProductItemM.sku3);
            lbl_title4.setText(str: mProductItemM.sku4);
            
            if(mProductItemM.proimg==nil){
                mProductItemM.proimg="";
            }
            img_head.contentMode=UIViewContentMode.scaleAspectFit
            img_head.kf.setImage(with: URL(string: Api.getImageUrl(mProductItemM.proimg ?? "" ) ), placeholder: Image(named: "PlaceHolderImage_small"), options: nil, progressBlock: nil) { (image, error, cacheType, imageURL) in
                if error == nil {
                    self.img_head.contentMode=UIViewContentMode.scaleAspectFill
                }
            }

            
           
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        backgroundColor = UIColor.clear
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
